using System;
using SKYPE4COMLib;

namespace Wra4Skype.Library
{
    public static class Extensions
    {
        /// <summary>
        /// Returns display name of user or full name if it does not exist
        /// </summary>
        public static string GetDisplayName(this IUser user)
        {
            if (user == null)
            {
                throw new ArgumentNullException("user");
            }

            if (string.IsNullOrEmpty(user.DisplayName))
            {
                return user.FullName;
            }
            else
            {
                return user.DisplayName;
            }
        }
    }
}